package studydemo.service.consumer.direct;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @author xn
 * @date 2022/11/20 20:14
 */
@Service
@RabbitListener(queues = "lonelyDirectQueue")//监听的队列名称 TestDirectQueue
public class LonelyDirectReceiverService {

    @RabbitHandler
    public void process(Map testMessage) throws InterruptedException {
        System.out.println("LonelyDirectReceiver消费者收到消息  : " + testMessage.toString());
        Thread.sleep(10000);
    }

}
